Refactor. 
Silent option for hiding error logs added.