Cleanup + Logging

Rename variables to be more consistent
Additional error logging