Refactored add fragment and activity