Refactored code to a muktuk package