refactored application for cleared background template generation