Refactoring: cap complexity at 15 and coverage at 90

Change-Id: I6e4de72ee6a3ecc825fe959b289d7e7e83e01bb9