Initial changes

Initial changes to improve the existing implementation.