encapsulated line into kline, moved keyhandler to index