refactored code. added paddings and backgrounds