Refactor and add some comments (ref #54)
Make sure object fields definitions are valid (ref #54)