clean code and refactore