moved and added tests