charmload: some refactoring to address review comments