refactor syscall wrappers