refactoring code components + variable status update