Core: small code refactoring.