check dependency before running class
remove redundant code