Remove unnecessary stuff in functions