smarter require path logic