Tided code up