Cleaned up a bit more code