Refactor code. Add enums.