Tidy up aceLoaded function