refactoring of render system