move functions, define a test, unused imports