This also tries to make the code as easy to extend as possible for future developments. Bug: 5701241 Change-Id: I1ed48e6a5cc7aab94c5d6e309930cc004247d7e7
This change also gets rid of several compiler warnings. Change-Id: I23962edaadad18a6e0395d528af17b909dcf5dad
Bug: 5119987 Change-Id: I35700fd8b0ffa6bced428cc6d46b3f64eb251281