code cleanup
wrapper methods for key and children
use method toArray instead of mapping