Some improvements for testability and License info added