Re-wrote with a more friendly api