refactored into helper methods to consolidate logic; added screenshots