update main activity clean code