Cleaned up a little (ok, rather a lot)