Extract functionality into module