Code Refactor. Fixes rSKf6407e3b8a61 and rSK6eb98061534d