Tiny refactor of API part