Few changes, mainly optimization