removing codeduplication