Lots of code cleanup in activity, initial codes