refactor to use ioslib library