refactors per matthew