optimizes code

optimizes code