little refactor + validate example