Refactor / Performance improvements