cleaned up small bits of code