Clean unused code
Write test