Refactor objects

I hope I haven't broken anything. Anyone wish to confirm this?
ebp is the object_type.