given nextmap enforcing switch
code cleanup