cleaning up the code to make it more presentable