Some attempts to improve performance