reorganized layout and style to be simpler in code