refactoring rendering engine-intoducing DI