cleanup and optimize code