use functions instead of methods in fs.lua