cleaned up the code, moved methods out of ninjacontroller class to client class where they belong