refactored to use backend/template