Separated algorithms into separate classes, added Utils class with commonly used methods