restructure, stub for tests, TODO