Addressed comments

Remove commetned code
Refactor duplicate code