refactor autoload and tests