Begun refactoring
go back to previous idea