refactored code into sections: activity, model, view and util