Cleaning code a bit