Added health check
Refactoring