Some refactoring

Signed-off-by: Peter <s3286430@student.rmit.edu.au>
Validation checking on client-side

Signed-off-by: Peter <s3286430@student.rmit.edu.au>