Refactor module structure