Encapsulated some behavior in appriate classes