Avoid code repetition in marker-related functions.