moved functions to their own defined header.