Removed redundant variable declarations and unneeded Set()