package structure amended to separate api and internals