Eliminate code duplicatin by introducing a trait