fleshing out common functions and modal