Split the structure, added unit tests.