move kernel to seperate file