moving require statements inside methods
docs