- Added assert
- made more unified