moar refactoring + demo2