Inlined some more stuff, cleaned up some code