removed logging statements, cleaned up code