refactor directory and modules