prettify and organize code