refractored files a bit