Module refactor. Added a test