Cleanup system functions
Swapped some places