Refactor to work with PBC autoloader