remove unused require and fix inconsistent returns