code refactoring as preparation for Cycles Render support