Parts of code refactored

- Comments added
- Enum moved to theirs own file