refactor application's API and structure