Refactor a bit and add completion for /opup