cleaning code

Just a few changes to make the code more neat