Simplify some things and cleanup