Added contracts and abstract validator class