Add aacgain and refactoring