Rework API a bit