Refactor class declarations