change type of rootFrame to MagicFrame, remove redundant casts
remove unused MagicTools class