Code refactoring. Fix code issue