refactored code and added some new stylings