Moved import popup code to a controller