refactored to include a shelter class