Some code clean ups