MRY refactoring (that doesn't affect performance)