implement different view modes for objects, some code beautification