Make code more readable by using custom asserts

Signed-off-by: Igor Popov <igor.popov89@gmail.com>