refactored with array of hashes