Implement @keradus's changes