add autoloads, move functions around