basic templates refactored