Made strict
Better error handling
Used config instead of hardcoded values