simplify logic
remove unused/not working function