Refactor code for pretiness.