Moved mapping function to data namespace