Split responsibilities into separate classes

Split responsibilities into separate classes