Second round of cleaned up code.