refactored some methods and added marker to the target function