Simplify memory mapping code.

Signed-off-by: Peter Atashian <retep998@gmail.com>