changed traits to more scala like way