Simple validation. Style improvements