extract controller functions to service
ensure template is rendered before drawing
refator service organization
Merge branch 'code-refactors'