Cleaning up code a bit to match moai conventions