add some spacing
remove repetitive if-tree