fix code review comments
fix tests