improved style of code