Various small changes.. cleaning up code