Refactor marker creation