Re-scoping class methods to allow unit testing