import completion uses less local functions (more testable!)