Some refactoring of the flexiant client. Implemented basic validation