EG: refactored; nice!