finishing refactor