Refactor/clean the newly introduced code

Use better method names, clean up the internal API.