refactor code.fix styling