Factor out credentials class.