Refactoring. Fixed visual bug