initial refactor to change the entire API