More cleanup of code