rebuilding model representation to more object-oriented one. will
benefit from cleaner and more concise code.