factoring out some methods, not working