completion on both sides, and refactoring