edit comments and refactor tests