refactored folder structure and module files. fixed some minor bugs