Code improvements.Tests