Removed TODO comment and tidied code slightly.