rewriting for custom backend
merged redo into master