extract generic completion related stuff into a separate module