refactors to views