made code nicer to view