fix reloading, remove unused code