Refactor + js select fixes