Made it work better with require()