Clean up code structure