Mostly code clean up