moved some common funcitonality from handlers to base handlers