[WIP] Implements more functional API