Tidied up feature and remove redundant code