more code optimalization