Global refactor and API simplification