Cleanup code

Refactor code.
Add final.

Change-Id: Ifaf681371adb9a7eeb6710d6a1bf569c53503739