add ascending option for query
refactor plain mapping to use general function