clean and organize code