Some refactoring and demo creation