refactored to better utilize class