clean and refactor (module currently broken)