simplfy marker drawing code