Collapsed a bit of activity code to be simpler