Refactor credential interface