remove unnecessary code and cleanup