finishing refactor2