- Removed double checking + ws changes
- Unnesting some code