reorganising implementation so that oself can be swapped and updating unit tests to reflect this