The code was cleaned up and an anonymos innser class was refactored.