removed redundant code
minor refactoring