Refactored point drawing into a function