move the method from ccUtils to Director