Tidy up of bullshit code.