major refactor 2in1