Model implementation + basic connection code