clean up and remove unnecessary code