Moving hex and logger to main code