fixing autoload directory and enhancing regular expressions