STYLE: Create functions to avoid having to write twice the same code and reduce writing functions size