refactor, cleaning the code