Removed global variables, added functions to check installed callbacks