Cleaned up left over encoder code