Move lastInsertId on its own method