refactored map / selection code