split into separate files and write interfaces