Start of seperating & simplifying code