Case simplification by using andalso and orelse
Use ets:tab() instead of own definition
Code simplification
Changed some uses of lists:map and lists:filter to comprehensions
Prettyfied some messages
Factor some common repeated code
Some tidying of code
Change lid from integer() to string()