Simplified implementation based on review comments by: Benoit