remove unused imports
Move protocol into separate file.