Refactor module into package