Adding TestActivity and some code cleanup