Ticket 42, some more code cleaning