--[[
	Picks certain keys out of a table and place them into a new table.

	Parameters:
	- t (table): table to pick keys from
	- keys (string[]): list of keys to pick from the table

	Returns:
	- picked (table): table containing all picked values
	- rest (table): table containing all other values from initial table
]]

return function(t, keys)
	local picked, rest = {}, {}
	for _, key in ipairs(keys) do
		picked[key] = t[key]
	end

	for key, value in pairs(t) do
		if picked[key] ~= nil then
			continue
		end

		rest[key] = value
	end

	return picked, rest
end
