Separated model from representation

Also added cubic bezier relative and some refactoring