Separated reusable fns into utils.py and added hostname tool.