Redundant sysouts deleted,some refactoring done