Improvements to insfrastructure. Only smart errors and testing are remained