refactor for minimum viable product