#80 moved methods to functions