Switch class implementation to traits/impls.