cleanup to use an array with map function