Readying for unittesting
Minor refactor