Refactoring + better inline html integration