separate getting suggestion logic from error handler