Code cleanUp, some resources fix