Namespaced the helper functions and improved trait detection