optimization and possible fixes