public cleanup

* removing unnecessary code,
* fix format and indentation,
* simplifying code.