Refactored the callbacks to split onfilereload and oncachereload actions