controller helper functions