refactor class structures