Bug check in progress. Refractoring.