break up inlet code into functions and its own module
break up inlet code into functions and its own module