move out IDE util functions
split out busy loops