refactored LTI handshake