Refactoring morhlines code into its own module