extract some code into Mappable module