refactored for SRP & DRY
more cleanup