Move classes into infrastructure package, add tests