Cleaning code up