get rid of redundant code & fix css