Cleaning up some code

No actual changes that affect performance