fixed not working tooltip; some refactoring