beautification of some code