moved functionality into module