Improve clock configuration code
Cleanup platform code