performance fixes #1