Refactoring of graphics engine. AH-140