Updated to use trait