Code clean up and re org