cleanup: move more stuff into functions
cleanup: move more stuff into functions

vmoravec/automation,aspiers/automation,vmoravec/automation,vmoravec/automation,SUSE-Cloud/automation,gosipyan/automation,aspiers/automation,gosipyan/automation,vmoravec/automation,gosipyan/automation,aspiers/automation,gosipyan/automation,SUSE-Cloud/automation,SUSE-Cloud/automation,SUSE-Cloud/automation,aspiers/automation