EMI: minor refactoring for setting chores and costumes

- refactor some repeated code blocks into a single function