Cleaned up code a bit, no fuctional change