Test/refactor API