Rest tests modification
Code cleanup and comments.