Inline finish function