Seperate AP code from the activity, comment it a bit