Added guard code on enabled, did some code cleanup.