Changed some tabs to spaces and tidied up private method names