refactor getExtras, copy-paste sucks