extract max_num to method