Please change this to a method rather than doing the logic here