Cleaned up a few places of code