refactoring and adding markers