Cleaning up using def