port the rest of Leather's functionality from master