refactored completion code