Dynamic traits using as keyword