remove unused code
cover with tests