Refactored border styling code and CSS

No functionality changes, better code clarity