unifying isMaster to function