clean up code structure