Moved def mapper() code to it's own class.