move functions inside module