Problem cleaning up the code

A link to the lcd datasheet would be useful, to understand its serial protocol.