Moved new code into independent class