Added logging and refactoring of utils/services