Few code optimizations

Signed-off-by: Fadion Dashi <jonidashi@gmail.com>