Some Modifications to allow for testing