code refactoring, redundancy removal