move max out into handlers.h