nice-ified some code