refactor and continued work

refactor and continued work: split into src/main and src/test