Fixing scrutinizer issues

Fixing scrutinizer issues including:
- unused vars
- unnecessary breaks
- requirements properly defined