added more compile-time validation