Separating actions into diferents functions and documenting functions