code clean up and some refactor; public defaults