refactor and restyle