Add set freq and enable function. Refactor init funtions. Add other test.