Move import check up to a more relevant place