Revert "Moved functions inside class declaration"

This reverts commit 2670de0bfa1da73a8ecf74ba2ca522afbb3ce366.