Refactor shared file even more