Removing debug messages
Fixing wrong return statement
Throwing exception instead of logging it for now
Restructuring