Adding more checks and proper logging instances