Started refactoring of design. Relates to #42