lxc: Separate more concerns and remove out of scope functions