profiles.lua: extracted method