edit and render basically working (plus some refactoring)