lcd: refactor and add commentary (part 2)