[#880] Clean up code