fix tests and use lambda functions
access catalog only if needed
fix indentation
use map() here as it works better in this case