Restructured the code, created some stubs.