unit and integration tests and logging added