funcionality moved into classes (minor fix)