Made the get_master function a little faster by reducing number of requests