Refactor class param handling