clean ups and partial implementation