Some API improvements