refactor cattr to avoid global namespace pollution

fixes #41