Refactor API + quality