refactor to move functionality to a func
remove HOST constant