Tests pass now, better code style.