Refactored Marker class to use constructor function