Add support for local profile script and other cleanup