Moved function to map class