Add more comments and type hints

Change-Id: I8c4b91d3a6695cc33c9c3d3fb427af5412323ff7