Re-writing some modules using Swift