centralized cap checks into two core functions for simplicity