Reduce code and memory use
further reduce map use