Refactoring activity, adding some new Junit Tests