Added some abstraction and dynamic marker adding