The concept of performing mathematical operations with metasurfaces has been suggested by Silva et al (Science 343, 160 (2014)). However, their proposed structure in implementing any transfer function (corresponding to any mathematical operator) for various input signals faces limitations. To tackle this issue, in this study, four different scenarios are proposed on their metasurface-based structure to generalize in a way that can implement each spatial transfer function. To evaluate the performance of the presented scenarios, seven different transfer functions are simulated to encompass a wide range of mathematical operators in the spatial domain. The implementations are based on the Fourier approach. Simulation results based on the finite element method closely match the desired values. From the results of this study, it can be seen that the third and fourth scenarios provide better accuracy. For example, when the fifth transfer function is performed by the basic structure and the fourth scenario, the normalized root mean square error, decreases from the value of 0.235 to the value of 0.0348, respectively. Furthermore, a tunable structure is achievable using the third scenario to produce different operators on the same structure. The realization of these scenarios is possible by using nanostructure-based metasurfaces.