Made few cleanups. More to come and comments need to be added