split API and implementation more