add: refactor completion functions