Fix unclosed fi
More abstraction