Cleaned and refactored and it is done