refactored for readable