move marker handling into router