finish refactor of code before css styling