moce more stuff out of syscall to common code