code re-organisation in classes