optimizations & get rid of warrings