small refactoring
lets make that api code way easier to read