refactor activity