minor changes: improves performance