Move user selection out to a function and use it in the post import too