Tests - remove duplicated code