updated main activity to be more OO