add single top for the main activity
do some refactors