Remove unused code and add pending tests