Move traits and object generator to proper place