Fixing merge conflict and simplifying api