clean up the code structure