Cleaned implementation