made requested refactors