Refactoring

- refactored goem to make code more readable
- moved functions to corresponding files
- made it more modular