moved order logic to mapper, adjusted tests