Removed logging and reformated code