refactor, test, and add more styling