Some code clean up