removed logging statements, cleaned up logic.