tidying up the codebase a little because due to all those recent changes it is a mess