Simplyify check_server logic, do not use magic constants everywhere